<html>
<body>


<?php
$file=fopen("05.txt","r");
//$file2=fopen('06.txt','r') or exit("无法打开此文件！");

IF(FEOF($file)) ECHO "读完了";

echo "按行读取：",PHP_EOL,"<br>";
while(!feof($file))
{
    echo fgets($file),"<br>";
}
if(feof($file)) {echo "读完了";}
fclose($file);
?>
<hr>
<?php
$file=fopen("05.txt","r");
echo "按字符读：",PHP_EOL,"<br>";
while(!feof($file))
{
    echo fgetc($file)," ";
}
if(feof($file)) {echo "读完了";}
fclose($file);
?>

</html>
</body>
